<div class="dialog-container mdl-shadow--8dp mdl-layout--fixed-header SMES-dialog B0219-dialog" ng-init="dialog.init();"
     style="background-color: #fafafa;width:100%;height: 100%;">
    
    <div class="kmi-header-row">
        <div class="header-title"  ng-show="dialog.mode=='trackout'" ng-bind="'A08.Dispatch' | translate"></div>
        <div class="kmi-side-btn left" ng-click="dialog.back(dialog);" ng-hide="dialog.mode=='trackout'">
            <i class="material-icons">&#xE408;</i>
            <div class="kmi-can-click"></div>
        </div>
        <div class="header-title" ng-bind="'B0219.headerTitle.column1' | translate" ng-show="dialog.mode == 'badReason'"></div>
        <div class="header-title" ng-bind="'B0219.headerTitle.column2' | translate" ng-show="dialog.mode == 'multiple'"></div>
        <div class="header-title" ng-bind="'B0206.production_inf.title' | translate" ng-show="dialog.mode == 'production_inf'"></div>
        <div class="kmi-side-btn right" ng-click="dialog.close();">
            <img src="image/icons/clear.png"></img>
            <div class="kmi-can-click"></div>
        </div>
    </div>
    <div class="kmi-layout-main-content">
       
        <!-- 派工方式 -->
        <!--20221201 add by shiwl -->
        <div class="kmi-text-fields conditoin-fields" >
          <label  class="label" ng-bind="'A08.Dispatch_mode' | translate"></label>
          <div>
            <button class="mdl-button mdl-js-button kmi-checkbox"  style="width:150px;" ng-click="dialog.changeAssignment(dialog.condition_item,condition_item.device_type=0)">
                    <img ng-show="dialog.condition_item.device_type!=0" src="image/icons/check0.png"></img>
                    <img ng-show="dialog.condition_item.device_type==0" src="image/icons/check1.png"></img>
                    {{'A08.appoint_device' | translate}}
             </button>
            <button class="mdl-button mdl-js-button kmi-checkbox"  style="width:150px;" ng-click="dialog.changeAssignment(dialog.condition_item,condition_item.device_type=1)">
                <img ng-show="dialog.condition_item.device_type!=1" src="image/icons/check0.png"></img>
                <img ng-show="dialog.condition_item.device_type==1" src="image/icons/check1.png"></img>
                {{'A08.appoint_date' | translate}}
            </button>
          </div>              
         </div>
          <!-- 派工数量 -->
        <!--20221201 add by shiwl -->
         <div class="kmi-text-fields conditoin-fields">
                <label class="label" ng-bind="'A02.workStationInput.list.column6' | translate"></label>
                <button class="mdl-button mdl-js-button kmi-checkbox"  style="width:161px;" ng-click="dialog.AssignmentNumber(dialog.condition_item,condition_item.date_type=1)">
                    <img ng-show="dialog.condition_item.date_type!=1" src="image/icons/check0.png"></img>
                    <img ng-show="dialog.condition_item.date_type==1" src="image/icons/check1.png"></img>
                    {{'A08.suggested_dispatching_quantity' | translate}}
                </button>
                <button class="mdl-button mdl-js-button kmi-checkbox"  style="width:150px;" ng-click="dialog.AssignmentNumber(dialog.condition_item,condition_item.date_type=2)">
                    <img ng-show="dialog.condition_item.date_type!=2" src="image/icons/check0.png"></img>
                    <img ng-show="dialog.condition_item.date_type==2" src="image/icons/check1.png"></img>
                    {{'A08.designated_dispatching_quantity' | translate}}
                </button>
              
         </div>
        
        <div class="kmi-layout-page trackout" ng-if="dialog.mode=='trackout'">
            <div class="kmi-text-fields" style="margin-bottom: 8px;" ng-if="dialog.plotData.rule_yield_ls!='' || dialog.plotData.rule_yield_lcl!=''">
                <label class="label" ng-if="dialog.plotData.rule_yield_ls!=''" ng-bind="'A02.plot_no' | translate"></label>
                <label class="value" ng-if="dialog.plotData.rule_yield_ls!=''" ng-bind="dialog.tmpLotNo"></label>
                <label class="label" style="padding-right: 5px;" ng-if="dialog.plotData.rule_yield_lcl!=''" ng-bind="'A08.dispatch_quantity' | translate"></label>
                <label style="padding-right: 10px;" class="value" ng-if="dialog.plotData.rule_yield_lcl!=''" ng-bind="dialog.qtyCopy"></label>
            </div>
            <div style="display: flex; flex-direction: row; justify-content: flex-end;" ng-if="dialog.op_plug_in == '1'">
                <div class="kmi-text-fields" style="flex: 0 0 30%;">
                    <label class="label" ng-bind="'B0219.heat_plot_no' | translate"></label>
                    <label class="value" ng-bind="dialog.heat_plot_no"></label>
                </div>
            </div>
             <div ng-show="dialog.condition_item.device_type==0">
                <div class="result"></div>
             </div>
            
            <!-- 指定日期 --> 
            <div class="kmi-list work-list column-selector" ng-show="dialog.condition_item.device_type==1" column-selector-id="trackOutDetail" style="height: 100%;">
                <div class="kmi-list__header">                  
                    <div class="kmi-list__column require" style="flex:1;min-width:175px;" ng-bind="'A05.equipment_view.equipment_no' | translate"></div>
                    <div class="kmi-list__column head-controls require" style="flex:1;">
                        <div class="order" >
                            <label ng-bind="'A03.list.column4' | translate"></label>
                        </div>
                    </div>
                    <div class="kmi-list__column head-controls" style="flex:1;">
                        <div class="order">
                            <label ng-bind="(dialog.detail.lst_ORM_EquipmentPeriodModel[dialog.dateIndex].work_date.split('-'))[1]+'/'+ (dialog.detail.lst_ORM_EquipmentPeriodModel[dialog.dateIndex].work_date.split('-'))[2]"></label>
                        </div>
                    </div>                   
                </div>
                <div class="kmi-list__row-content" >
                   <div class="kmi-list__row" ng-repeat="item in  dialog.machine_detail">                               
                     <div class="kmi-list__column " ng-class="{'column-border':item.machine_no!='合计'}" style="flex:1;min-width:175px;font-size: 14px;" ng-bind="item.machine_no"></div>                      
                     <div class="kmi-list__column column-border" style="flex:1;font-size: 14px;"  ng-bind="item.machine_name"></div>
                     <div class="kmi-list__column column-input column-border" style="flex:1;z-index:1;position: relative;">
                       <input type="text" ng-click="dialog.dateSetDispatchVolume($event, item, $index);" ng-model="item.lst_ORM_EquipmentPeriodModel[0].qty" readonly="readonly">
                     </div>                       
                   </div>
                </div>
            </div>
           
            <div class="btn-panel">
                   <div style="display: flex">   
                    <div class="kmi-button kmi-button-confrim btn-confirm" style="width:100px" ng-click="dialog.confirmCheck()">
                      <label ng-bind="'B0219.label.column3' | translate"></label>
                      <div class="kmi-can-click"></div>
                   </div>                 
                    <div class="kmi-button kmi-button-cancel"  ng-click="dialog.dispatchClear()" style="width:100px">
                        <label ng-bind="'common.btn.clear' | translate"></label>
                        <div class="kmi-can-click"></div>
                    </div>
                </div>
                
            </div>
        </div>
        <!-- 不良原因 -->
        <div class="kmi-layout-page badReason" ng-show="dialog.mode=='badReason'">
            <div class='search-bad-column'>
                <!-- 快速查询 -->
                <div class="kmi-text-fields qr-code left" style="width:50%;padding: 0 8px 0 0;">
                    <label class="label ng-binding" ng-bind="'B0206.badReason.input_barcode' | translate" style="text-align: left;"></label>
                    <input class='searching-bad' ng-model="dialog.tmpBadTypeName" ng-keypress="dialog.bd_scan($event);" style="flex:1;">
                    <div class="tip qrcode" ng-click="dialog.qrcode_plot_no();">
                        <img src="image/icons/QRCode.png">
                    </div>
                </div>
            </div>
            <div class='badReason-content-page'>
                <div class="left">
                    <div class="kmi-list__row" ng-repeat-start="item in dialog.badTypeList" ng-click="dialog.clickTypeItem(item);" ng-class="{'isSelect':item.reason_type == dialog.tmpBadType}">
                        <i class="material-icons close">indeterminate_check_box</i>
                        <i class="material-icons open">add_box</i>
                        <div class="kmi-list__column" ng-bind='item.reason_sub_type'></div>
                        <div class="kmi-can-click"></div>
                    </div>
                    <div class="kmi-list inner-list" ng-show="item.reason_type == dialog.tmpBadType" ng-repeat-end>
                        <div class="kmi-list__row-content">
                            <div class="kmi-list__row bdreason_list" ng-click='dialog.add_BadReason_selected(subItem)' ng-repeat="subItem in item.badReason_list | filter: { chosen : '!Y' }">
                                <div class="kmi-list__column column1" style='flex: 0 0 130px;border-right: 1px solid #eaebeb;' ng-bind='subItem.reason_no'></div>
                                <div class="kmi-list__column column2" style='flex: 1;border-right: 1px solid #eaebeb;' ng-bind='subItem.reason_name'></div>
                                <!-- <div class="kmi-list__column column3" ng-bind='item.qty'></div> -->
                                <div class="kmi-list__column column4" style='flex:0 0 40px'>
                                    <button class='mdl-button' style='min-width: 100%;padding: 0;'>
                                        <img src="image/icons/move4.png">
                                    </button>
                                </div>
                                <div class="kmi-can-click"></div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="right">
                    <div class="kmi-list">
                        <div class="kmi-list__header">
                            <!-- <div class="kmi-list__column" style="flex:1;" ng-bind="'B0206.trackOut.prodPatchNo1' | translate" ></div> -->
                            <div class="kmi-list__column" style="flex:0 0 40px;"></div>
                            <div class="kmi-list__column" style="flex:1;" ng-bind="'B0206.badReason.reason_type' | translate"></div>
                            <div class="kmi-list__column" style="flex:1;" ng-bind="'B0206.badReason.reason' | translate"></div>
                            <div class="kmi-list__column" style="flex:1;" ng-bind="'B0206.badReason.badNo' | translate"></div>
                            <div class="kmi-list__column" style="flex:0 0 104px;" ng-bind="'B0206.badReason.badQty_0' | translate"></div>
                        </div>
                        <div class="kmi-list__row-content">
                            <div class="kmi-list__row" ng-repeat="item in dialog.select_detail.abnormal_detail track by $index">
                                <!-- <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.plot_no"></div> -->
                                <div class="kmi-list__column" style="flex:0 0 40px;">
                                    <button class="mdl-button mdl-js-button mdl-button--icon" ng-click="dialog.delete_BadReason_selected(item)">
                                        <img src="image/icons/move5.png">
                                    </button>
                                </div>
                                <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.abnormal_type_name"></div>
                                <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.abnormal_name"></div>
                                <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.abnormal_no"></div>
                                <div class="kmi-list__column bad_qty" style="flex:0 0 104px;">
                                    <input ng-model='item.defect_qty' ng-click="dialog.AbnormalQtyAdjust($event, item);" readonly="readonly">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="search-tool">
                <div class="kmi-button kmi-button-confrim btn-confirm" ng-click="dialog.badReason_confirm()" style="width:100px">
                    <label ng-bind="'B0206.confirm' | translate"></label>
                    <div class="kmi-can-click"></div>
                </div>
                <div class="kmi-button kmi-button-cancel"   ng-click="dialog.badReasonCancel(dialog)" style="width:100px">
                    <label ng-bind="'common.btn.close' | translate"></label>
                    <div class="kmi-can-click"></div>
                </div>
                
            </div>
        </div>  
        <!-- 生產資訊收集 -->
        <div class="kmi-layout-page production_inf" ng-show="dialog.mode=='production_inf'">
            <div class="kmi-list">
                <div class="kmi-list__header">
                    <div class="kmi-list__column" style="flex:0 0 32px;"></div>
                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0206.production_inf.list.column1' | translate"></div>
                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0206.production_inf.list.column2' | translate"></div>
                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0206.production_inf.list.column3' | translate"></div>
                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0206.production_inf.list.column4' | translate"></div>
                </div>
                <div class="kmi-list__row-content">
                    <div class="kmi-list__row" ng-repeat="item in dialog.plotData.production_inf_detail track by $index">
                        <div class="kmi-list__column column-border" style="flex:0 0 32px;" ng-bind="$index+1"></div>
                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.productioninf_no"></div>
                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.productioninf_name"></div>
                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.description"></div>
                        <div class="kmi-list__column  column-input" style="flex:1;">
                            <input ng-if="item.method =='1'" ng-model="item.productioninf_value" />
                            <div ng-if="item.method =='2'" class="check-point-switch" ng-class="{'is-selected':item.productioninf_value == '1'}"
                                 ng-click="dialog.switchClick(item);" ng-init='dialog.switchInit(item);'>
                                <div style="width:24px;height:24px;"></div>
                            </div>
                            <input ng-if="item.method =='3'" mdl-calculater="item.productioninf_value">
                        </div>
                    </div>
                </div>
            </div>
            <div class="btn-panel">
                <div class="kmi-button kmi-button-confrim btn-confirm" ng-click="dialog.productionInfConfirm()" style="width:100px">
                    <label ng-bind="'B0206.confirm' | translate"></label>
                    <div class="kmi-can-click"></div>
                </div>
                
            </div>
        </div>
    </div>
</div>
